403f0a0f1fdec70654e965cbd887561c920fc441,app/src/main/java/com/github/yeriomin/yalpstore/DownloadRequestBuilder.java,DownloadRequestBuilder,build,#,26
Before Change
public DownloadManager.Request build() {
HttpCookie cookie = deliveryData.getDownloadAuthCookie(0);
DownloadManager.Request request = new DownloadManager.Request(getDownloadUri());
request.addRequestHeader("Cookie", cookie.getName() + "=" + cookie.getValue());
request.setDestinationUri(getDestinationUri());
request.setDescription(app.getPackageName());
request.setTitle(app.getDisplayName());
After Change
public DownloadManager.Request build() {
DownloadManager.Request request = new DownloadManager.Request(getDownloadUri());
if (deliveryData.getDownloadAuthCookieCount() > 0) {
HttpCookie cookie = deliveryData.getDownloadAuthCookie(0);
request.addRequestHeader("Cookie", cookie.getName() + "=" + cookie.getValue());
}
request.setDestinationUri(getDestinationUri());
request.setDescription(app.getPackageName());